I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView.
Dictionary<Guid, Record> dict = GetAllRecords();
List<Record> searchResults = new List<Record>();
var matches = dict.Values.Where(rec => rec.Name == "foo");
foreach (Record rec in matches)
searchResults.Add(rec);
myListView.DataSource = searchResults;
myListView.DataBind();
Pravesh Singh
14-Nov-2013Hi Ben,
Try this:
var matches = dict.Values.Where(rec => rec.Name == "foo").ToList();